// Vuex 配置

// 引入Api
import {creatStore} from "vue"
import moduleA from './modules/moduleA'
import moduleB from './modules/moduleB'


// 引入element
const store = creatStore({
    modules: {
        a:moduleA,
        b:moduleB
    },
    state() {
        return {
            count: 10
        }
    },
    getters: {
        tenTimes: (state) =>{
            return state.count = 10
        }
    },
    mountions: {
        increment(state,payload) {
            state.count = payload.count
        }
    },
    actions: {
        asyncIncrement(context,payload) {
            context.commit('incrment', payload)
        }
    },
    state(){
        return{
        // name:'',
        // age:'',
        // phone:'',
        userInFo:{}
    }
},
    mutations:{
        updateUserInFo(state,payload){
            console.log('payload',payload);
            state.userInFo = payload
        }
    }
    
})
export default store;